/*
 * This class handle the name and how much score a user gets in a game. 
 */
package cth.tda367.beavers.glossaryGame.model;

public class Score implements Comparable<Object> {
	
	private double point;
	private String name;
	
	
	public Score (String name, double totalScore) {
		this.point = totalScore;
		this.name = name;
	}
	
	

	public String getName() {
		return name;
	}
	
	public double getPoint () {
		return point;
	}

	@Override
	public int compareTo(Object obj) {
		if(obj instanceof Score) {
			Score o = (Score)obj;
			
			if(this.point > o.point) {
				return -1;
			}
			
			if(this.point  < o.point) {
				return 1;
			}
		}
		
		return 0;
	}
	
	

}
